function r = deprdv(cost, salvage, accum)
%DEPRDV Remaining depreciable value.
%
%   R = deprdv(COST, SALVAGE, ACCUM)
%
%   Inputs:
%      COST - Scalar or vector of the cost of the asset.
%
%   SALVAGE - Scalar or vector of the salvage value.
%
%     ACCUM - Scalar or vector of the accumulated depreciation of the asset for
%             the prior periods.
%
%   Outputs:
%
%         R - Scalar or vector of the remaining depreciable value.
%
%   Example:
%      The cost of an asset is $13,000 with a life of 10 years. The salvage
%      value of the asset is $1000. To find the remaining depreciable value
%      after 6 years, use the following commands. Find the accumulated
%      depreciation with the straight-line depreciation function, DEPSTLN.
%
%      accum = depstln(13000, 1000, 10)*6 = 7200
%      accum =
%              7200
%
%      r = deprdv(13000, 1000, 7200)
%      r =
%              4800
%
%   See also DEPFIXDB, DEPGENDB, DEPSOYD, DEPSTLN.

%   Copyright 1995-2008 The MathWorks, Inc.
%   $Revision: 1.6.2.4 $   $Date: 2008/02/02 13:04:48 $

if nargin < 3
   error('finance:deprdv:missingInputs', ...
      'Too few inputs.')
end

try
   r = cost-salvage-accum;

catch E
   error('finance:deprdv:calcError', E.message)
end


% [EOF]
